package net.neiquan.neiquandemowithkf.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import net.neiquan.neiquandemowithkf.R;

import net.neiquanlib.base.MyBaseAdapterListView;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 作者 ： hjb
 * 时间 ： 2016/7/18.
 */

public class ListviewDemoAdapter extends MyBaseAdapterListView {

    public ListviewDemoAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        ViewHolder viewHolder;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.list_item_card_detail, null);
            viewHolder = new ViewHolder(convertView);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }

    @Override
    public int getCount() {
        return 10;
    }

    static class ViewHolder {
        @InjectView(R.id.row_title)
        TextView mRowTitle;
        @InjectView(R.id.row_iv)
        ImageView mRowIv;
        @InjectView(R.id.row_red_dot_is_had_opened)
        ImageView mRowRedDotIsHadOpened;
        @InjectView(R.id.pic_rl)
        RelativeLayout mPicRl;
        @InjectView(R.id.myclass_classmateprogress_text)
        TextView mMyclassClassmateprogressText;
        @InjectView(R.id.students_progress)
        TextView mStudentsProgress;
        @InjectView(R.id.pro_students)
        ProgressBar mProStudents;
        @InjectView(R.id.myclass_myprogress_text)
        TextView mMyclassMyprogressText;
        @InjectView(R.id.my_progress)
        TextView mMyProgress;
        @InjectView(R.id.pro_me)
        ProgressBar mProMe;
        @InjectView(R.id.myclass_myprogress)
        RelativeLayout mMyclassMyprogress;
        @InjectView(R.id.credit)
        TextView mCredit;
        @InjectView(R.id.tx_start)
        TextView mTxStart;
        @InjectView(R.id.myclass_contunue_study)
        LinearLayout mMyclassContunueStudy;

        ViewHolder(View view) {
            ButterKnife.inject(this, view);
        }
    }
}
